package org.jeecg.utils;



import org.springframework.web.multipart.MultipartFile;
//import weibo.weibo4j.http.BASE64Encoder;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Base64;

public class BaseImg64Utils {
    public static String getImageStrFromMultiPartFile(MultipartFile file) throws IOException {
        byte[] bytes = file.getBytes();
        String base64String = Base64.getEncoder().encodeToString(bytes);
        return "data:image/jpeg;base64," + base64String; // 确保这里的MIME类型与图片类型匹配
    }
}
